﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="css/plupload.queue.css" type="text/css" media="screen" />
<title>Plupload - Flash上传演示</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.plupload.queue.min.js"></script>
<script type="text/javascript" src="plupload.min.js"></script>
<script type="text/javascript" src="plupload.flash.min.js"></script>
<script type="text/javascript">
	$(function () {
		// 初始化Flash上传插件
		$("#flash_uploader").pluploadQueue({
			runtimes: 'flash', 	//使用Flash插件
			url: 'upload.aspx', 	//服务器端响应页面
			max_file_size: '100mb', //最大文件限制
			chunk_size: '100kb', 	//一次上传数据大小
			unique_names: true, 	//是否自动生成唯一名称
			filters: [				//文件类型限制
				{title: "常用文件", extensions: "pdf,doc,docx,xls,xlsx,ppt,pptx,jpg,gif,png,zip,rar,txt" },
				{title: "图片文件", extensions: "jpg,gif,png" },
				{ title: "压缩文件", extensions: "zip,rar" }
			],

			// 缩放图片
			//resize: { width: 320, height: 240, quality: 80 },

			// SWF文件位置
			flash_swf_url: 'plupload.flash.swf',

			init: {
				FileUploaded: function (up, file, info) {
					//一个文件上传成功
					alert(info.response);
				},

				Error: function (up, args) {
					//发生错误
					if (args.file) {
						alert('[error] File:' + args.file);
					} else {
						alert('[error]' + args);
					}
				}
			}
		});
	});
</script>

</head>
<body>

	<h1>Plupload Flash上传演示</h1>
	
	<div>
		<div id="flash_uploader" style="width: 600px; height: 400px;">您没有安装Flash！</div>
	</div>

</body>
</html>